**Alternative Models - Generalized Structural Equation Models (GSEM's) Comparing Black and White Members and Constituents
**The set of GSEM models will take more than 12 hours to produce all results

**use "/Users/user/Downloads/POLCOMM City Council Data Processed Final.dta"

**TABLE H1
*****************************************************************************************************************

**Distraction During First 30 Seconds (Linear Model for Comparison)
mixed new30sec i.black_white_const##i.black_white_rep i.gender_rep i.gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city i.cat_sptotal2 order2 i.freq_const2 i.ward_rep i.conf_meeting || _all: R.rep || const1:
*Linear 1 Column; Difference for Black and White Member Rows (use results from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) 
*Linear 1 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) 

*Distraction During First 30 Seconds Model (GSEM )
gsem (new30sec <- i.black_white_const##i.black_white_rep gender_rep gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city i.cat_sptotal2 order2 freq_const2 i.ward_rep i.conf_meeting M1[rep] M2[const1]), family(binomial 30) link(logit) iterate(400)

**does not converge
matrix b = e(b)
matrix list b

**start at different initial values
gsem (new30sec <- i.black_white_const##i.black_white_rep gender_rep gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city i.cat_sptotal2 order2 freq_const2 i.ward_rep i.conf_meeting M1[rep] M2[const1]), family(binomial 30) link(logit) from (b)

**converged at iteration 8
*GSEM 1 Column; Difference for Black and White Member Rows (use results from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) predict (mu fixedonly)
*GSEM 1 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) predict (mu fixedonly)

*****************************************************************************************************************

**Distraction During First 60 Seconds (Linear Model for Comparison)
mixed new1minute i.black_white_const##i.black_white_rep i.gender_rep i.gender_const i.domin_topic i.same_opinion i.content_race i.content_class i.city i.cat_sptotal1 order2 i.freq_const2 i.ward_rep i.conf_meeting || _all: R.rep || const1:
*Linear 2 Column; Difference for Black and White Member Rows (use esults from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) 
*Linear 2 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) 

**Distraction During First 60 Seconds (GSEM) 
gsem (new1minute <- i.black_white_const##i.black_white_rep gender_rep gender_const i.domin_topic i.same_opinion i.content_race i.content_class i.city i.cat_sptotal1 order2 freq_const2 i.ward_rep i.conf_meeting M1[rep] M2[const1]), family(binomial 60) link(logit) iterate(700)

**does not converge 
matrix b = e(b)
matrix list b

**start at different initial values
gsem (new1minute <- i.black_white_const##i.black_white_rep gender_rep gender_const i.domin_topic i.same_opinion i.content_race i.content_class i.city i.cat_sptotal1 order2 freq_const2 i.ward_rep i.conf_meeting M1[rep] M2[const1]), family(binomial 60) link(logit) from (b)

**Converged at iteration 7
*GSEM 2 Column; Difference for Black and White Member Rows (use results from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) predict (mu fixedonly)
*GSEM 2 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) predict (mu fixedonly)

*****************************************************************************************************************

**Distraction During 61-120 (Linear Model for Comparison)
mixed new2minutes i.black_white_const##i.black_white_rep i.gender_rep i.gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city i.cat_sptotal2 order2 i.freq_const2 i.ward_rep2 || _all: R.rep || const1:
*Linear 3 Column; Difference for Black and White Member Rows (use results from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) 
*Linear 3 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) 

**Distraction During 61-120 Seconds (GSEM)
gsem (new2minutes <- i.black_white_const##i.black_white_rep gender_rep gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city i.cat_sptotal2 order2 freq_const2 i.ward_rep2  M1[rep] M2[const1]), family(binomial 60) link(logit) iterate(700)

*converges at iteration 343
*GSEM 3 Column; Difference for Black and White Member Rows (use results from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) predict (mu fixedonly)
*GSEM 3 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) predict (mu fixedonly)

*****************************************************************************************************************

**Distraction During 121-180 Seconds (Linear Model for Comparison)
mixed new3minutes i.black_white_const##i.black_white_rep i.gender_rep i.gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city ib4.cat_sptotal1 order2 i.freq_const2 i.ward_rep2 || _all: R.rep || const1:
*Linear 4 Column; Difference for Black and White Member Rows (use results from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) 
*Linear 4 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) 

*Distraction During 121-180 Seconds (GSEM) 
gsem (new3minutes <- i.black_white_const##i.black_white_rep gender_rep gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city ib4.cat_sptotal1 order2 freq_const2 i.ward_rep2 M1[rep] M2[const1]), family(binomial 60) link(logit) iterate(1500)

**does not converge 
matrix b = e(b)
matrix list b

**start at different initial values
gsem (new3minutes <- i.black_white_const##i.black_white_rep gender_rep gender_const i.domin_topic i.same_opinion i.content_race i.content_class ib6.city ib4.cat_sptotal1 order2 freq_const2 i.ward_rep2 M1[rep] M2[const1]), family(binomial 60) link(logit) from (b)

*converges at iteration 4
*GSEM 4 Column; Difference for Black and White Member Rows (use results from 1st set of rows in output)
margins, dydx(*) over(black_white_rep) predict (mu fixedonly)
*GSEM 4 Column; Difference for Black and White Constituent Rows (use results from 2nd set of rows in output)
margins, dydx(*) over(black_white_const) predict (mu fixedonly)


